from keras import layers
from keras import models
from keras.datasets import mnist
import numpy as np
import cv2

model = models.load_model('./model')

(train_images,train_labels),(test_images,test_labels) = mnist.load_data()





train_images = train_images.reshape((60000,28,28,1))
train_images = train_images.astype('float32')/255


a = train_images[10:30]



print(a.shape)
print(a[0])

resarr  = model.predict(a)
res = []
#
for x in resarr:
    #print( )
    arr = x.tolist()
    res.append(arr.index(max(arr)))


print (res)


print(train_images[5].shape)

#
# cv2.imshow('5',train_images[5])
# cv2.imshow('6',train_images[6])
# cv2.imshow('7',train_images[7])
#
# cv2.waitKey(0)
# cv2.destroyAllWindows()